package yawning.mew.gui.tools;

import yawning.mew.character.Talent;
import yawning.mew.character.Toon;

/**
 * Talent that contains the methods necessary to obtain and modify talents for toons.
 */
public class TalentWrapper {
	Talent talent;
	Toon toon;
	

	public TalentWrapper(Talent talent, Toon toon)
	{	
		this.talent = talent;
		this.toon = toon;
	}
	
	public int getColum()
	{
		return talent.getColumn();
	}
	
	public int getTier()
	{
		return talent.getTier();
	}
	
	public int getRank()
	{
		return toon.getTalent(talent);
	}
	
	public int getMaxRank()
	{
		return talent.getMaxRank();
	}
	
	public String getDescription()
	{
		int rank = getRank();
		if(rank>0)
		{
			return talent.getDescription(rank);
		}
		else
		{
			return talent.getDescription(1);
		}
	}
	/**
	 * Function that sets a rank of this talent.
	 * @param rank
	 * 	Rank to set. 
	 * 	This value must be between 0 and the maxRank,
	 *  This value must not make the user go over his/her talent points budget.
	 */
	public void setRank(int rank)
	{
		
		if(talent.getMaxRank()<= rank && rank>=0)
		{
			//int currentRank = toon.getTalent(talent);
			//int deltaRank = rank - currentRank;
			//int pointsUsed = toon.getTalentPointsCount() + deltaRank;
			
			
			//TODO handling of setting the rank.  We might have to us a validator on the UI side.
			
		}
	}
}
